<div class="containertable">
<h2>{$smarty.const.LA_SEARCH}</h2>
<p class="headline">{$smarty.const.LA_SEARCH_DESCR}</p> 
<p>&nbsp;</p>
<table border="0" width="100%" cellspacing="0" cellpadding="10">
<tr>
    <td width="100%">

    <form action="search.php" name="itemForm" id="itemForm" method="get">
    <script language="javascript">
	xajax_myFunction('{$reg_2_value}');
	xajax_myFunction('{$reg_3_value}');
	</script> 
	<input name="do_search" type="hidden" value="Search" /> 
	<table cellspacing="3" border="0">
	<tr>
		<td><span style="text">{$smarty.const.LA_SEARCH}</span> </td>
		<td><input id="searchword" name="searchword" size="25" class="txt" value="{$searchword}" /></td>
	</tr>
	
	<tr>
		<td><span style="text">{$smarty.const.LA_S_CATEGORY}</span> </td>
		<td>
		<select name="catid_search" class="regionselect" onchange="submit();">
	
		<option value='0'>{$smarty.const.LA_ALL}</option>
		{$catlist}
		</select>
	
		</td>
	</tr>
		
	{if $set_region==1}
	<tr>
    	<td><span style="text">{$smarty.const.LA_REGION}</span></td>
    	<td valign="top">
		<select id="reg_1" name="reg_1" onChange='xajax_myFunction(reg_1.value)' class='regionselect'>
		{$reg_1_options}
		</select>
	
		<p><div id="DropDown2"></div></p>
		<p><div id="DropDown3"></div></p>
	
		</td>	
	</tr>
  	{/if}
  	
  	
{foreach item=e from=$extra_fields_array}

{if $e.q_include_search==1}
{if $e.q_catdescr}
	<tr><td colspan="2">
   		<b>{$e.q_catdescr}</b><hr style="color:black;" width="50%" align="left">
	</td></tr>
{/if}

<tr>
	<td valign="top">{$e.q_question} </td>
   	<td valign="top">
   	
	   	{if $e.q_type=="t"}
			
	   	 	{if $e.q_between==1}
	   	 	{$smarty.const.LA_BETWEEN} 
	   	 		<input type="text" name="e_{$e.q_field}_from" size="{$e.q_size}" value="{$e.q_value_from}" />
	   		{$smarty.const.LA_AND}
	   	 		<input type="text" name="e_{$e.q_field}_to" size="{$e.q_size}" value="{$e.q_value_to}" />
	   		{else}
	   		<input type="text" name="e_{$e.q_field}" size="{$e.q_size}" value="{$e.q_value}" />
	   		{/if}
	   		
	   	{elseif $e.q_type=="p"}
			
	   	 	{if $e.q_between==1}
	   	 	{$smarty.const.LA_BETWEEN} 
	   	 		<input type="text" name="e_{$e.q_field}_from" size="4" value="{$e.q_value_from}" />
	   		{$smarty.const.LA_AND}
	   	 		<input type="text" name="e_{$e.q_field}_to" size="4" value="{$e.q_value_to}" /> {$set_currency_text}
	   		{else}
	   		<input type="text" name="e_{$e.q_field}" size="{$e.q_size}" value="{$e.q_value}" />
	   		{/if}
	   		
	   	{elseif $e.q_type=="d"}
	
	   		<textarea cols="{$e.q_size}" rows="{$e.q_size_2}" name="e_{$e.q_field}">{$e.q_value}</textarea>
	   		
	   	{elseif $e.q_type=="c"}
	   		{foreach item=opt from=$e.options}
	   		<input type="checkbox" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.selected_value} checked{/if}>
	   			{$opt.text} <br />
	   		{/foreach}
	
	   	{elseif $e.q_type=="s"}
	   		
	   		<select name="e_{$e.q_field}" class="txt">
	   		<option value=''>--</option>
		   	{foreach item=opt from=$e.options}
	   			<option value="{$opt.value}" {if $opt.selected_value} selected{/if}>{$opt.text|escape}</option>
	   		{/foreach}
	   		</select>
	   		
	   	{elseif $e.q_type=="r"}
	   		
	   		{foreach item=opt from=$e.options}
	   			<input type="radio" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.selected_value} checked{/if}>
	   			{$opt.text} <br />
	   		{/foreach}
	   		
	   		
	   	{/if}
	

   	
   </td>
</tr>
{/if}

{/foreach} 
		

<tr>
	<td colspan="2"><input type="submit" class="button" name="do_search" value="{$smarty.const.LA_SEARCH}" />
	<input type="submit" class="button" name="reset" value="Reset" />
	</td>
</tr>
</table>
</form>

{if $hide!=1} 
<table cellspacing="0" class="box" style="clear:both;">
<tr>
	<th width="25%">{$CATEGORY_URL} {$smarty.const.CATEGORY}</a> {$image_cat}</th>
	<th width="35%">{$AD_URL} {$smarty.const.TITLE}</a></a> {$image_title}</th>
	{foreach item=extra from=$EXTRA_CAPTION_ARRAY} 
		<th>{$extra.url}{$extra.caption|truncate:15:"...":true}</a> {$extra.sort_img}</th>
	{/foreach}
	<th width="10%">{$DATE_URL} {$smarty.const.DATE_ADDED}</a> {$image_date}</th>
	<th width="10%">{$EXPIREDATE_URL} {$smarty.const.LA_AD_EXPIRE}</a> {$image_expire}</th>
	<th width="15%">{$smarty.const.LA_GRADE} {$image_grade}</th>
	<th width="10%">{$PICTURE_URL} {$smarty.const.PICTURE_TEXT}</a> {$image_picture}</th>
</tr>		


{foreach item=ad from=$ads}  
{if $ad.NB is even by 1}
	<tr class="alt">
{else}
	<tr>
{/if}
<td class="category">{$ad.CATEGORYNAME}</td>
<td class="pointer"><a href="{$ad.LINK}">
{if $ad.SPECIAL}<b>{/if}{$ad.TITLE}{if $ad.SPECIAL}</b>{/if}</a></td>
{*foreach item=extraval from=$ad.EXTRA_VALUES} 
		<td>{$extraval|truncate:20:"...":true}</td>
{/foreach*}
<td>{$ad.REGDATE}</td>
<td>{$ad.EXPIREDATE}</td>
<td>{$ad.GRADE}</td>
<td>{$ad.IMAGEYESNO}</td></tr>
{/foreach} 

<tr>
<td colspan="6" align="center">
{if $prev_url} 
	<a href="{$prev_url}" class="button nextPrev">&lt; {$smarty.const.PREVIOUS_ADS} {$NUM_PER_PAGE}</a> 
{else}
	
{/if}

{if $next_url}	
	<a href="{$next_url}" class="button nextPrev">{$smarty.const.NEXT_ADS} {$NUM_PER_PAGE} &gt;</a> 
{else}	

{/if}
</td></tr></table>

{/if}  
    
</td></tr></table>    



{literal}
<script language="javascript" type="text/javascript">
<!--
content=document.getElementById("searchword");
if( content != null ){content.focus();}
-->
</script>
{/literal}

</div>